package com.hskn.hss.module.carTrackOriginal.controller;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hskn.hss.core.annotation.SysLog;
import com.hskn.hss.core.enums.BusinessType;
import com.hskn.hss.entity.AjaxResult;
import com.hskn.hss.exception.HssException;
import com.hskn.hss.module.alarmsheshi.entity.AlarmSheshi;
import com.hskn.hss.module.alarmsheshi.mapper.AlarmSheshiMapper;
import com.hskn.hss.module.carTrack.dto.CarTrackDto;
import com.hskn.hss.module.carTrack.to.CleanListTo;
import com.hskn.hss.module.carTrack.to.LastCarTrackTo;
import com.hskn.hss.module.carTrack.to.MileageAndOilWearTo;
import com.hskn.hss.module.carTrack.vo.FaclCleanListVo;
import com.hskn.hss.module.carTrack.vo.LastCarTrackVo;
import com.hskn.hss.module.carTrackOriginal.entity.CarTrackOriginal;
import com.hskn.hss.module.carTrackOriginal.mapper.CarTrackOriginalMapper;
import com.hskn.hss.module.carTrackOriginal.service.CarTrackOriginalService;
import com.hskn.hss.module.carTrackOriginal.to.CarTrackGridTo;
import com.hskn.hss.module.common.to.OilNumTO;
import com.hskn.hss.module.tlcar.entity.TlCar;
import com.hskn.hss.module.tlcar.mapper.TlCarMapper;
import com.hskn.hss.module.videoplan.mapper.VideoPlanMapper;
import com.hskn.hss.task.HssTask;
import com.hskn.hss.task.WorkTask;
import com.hskn.hss.utils.Tools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author hskn
 * @since 2021-05-21
 */
@Api(tags = {"-car_track"}, description = "轨迹")
@Slf4j
@RestController
@RequestMapping("/hss/carTrackOriginal")
public class CarTrackOriginalController {
    @Autowired
    private CarTrackOriginalService carTrackOriginalService;
    /**
     * 从KfkCarLocation补点到CarTrack
     *
     * @param oilNumTO
     * @return
     */
    @PostMapping(value = "supplementaryCarTrackPoints")
    public AjaxResult supplementaryCarTrackPoints(@RequestBody @Validated OilNumTO oilNumTO) {
        try {
            carTrackOriginalService.supplementaryCarTrackOriginalPoints(oilNumTO);
            return AjaxResult.success("操作成功");
        } catch (Exception e) {
            e.printStackTrace();
            log.error("报错ERROR", e);
            return AjaxResult.fail("操作失败");
        }
    }
}

